<form action="/admin/order" method="post" enctype="multipart/form-data" name="adminorder" id="adminorder" style="margin:0; padding:0" onsubmit="return verifyloginForm(this)">
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td class="bgtitle"><table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                    <tr>
                        <td width="20"><img src="/templates/images/mui_ten.gif" /></td>
                        <td valign="bottom" class="title">Danh sách đơn đặt hàng</td>
                        <td width="10" valign="bottom">&nbsp;</td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td valign="top" >&nbsp;</td>
        </tr>

    </table>
    <table width='98%' align='center' border='0' cellpadding='2' cellspacing='0' bordercolor='#CCCCCC' style='border-collapse:collapse'>
        <tr>
            <td height='30' class='bgmenupro border3' bgcolor='#DDDDDD' width='5%'><div align='center'>
                    <strong>STT</strong>
                </div>
            </td>
            <td class='bgmenupro border3' bgcolor='#DDDDDD' width='15%'>
                <div align='center'>
                    <strong>Ngày đặt hàng</strong>
                </div>
            </td>
            <td class='bgmenupro border3' bgcolor='#DDDDDD' width='20%'>
                <div align='center'>
                    <strong>Mã đơn hàng</strong>
                </div>
            </td>
            <td class='bgmenupro border3' bgcolor='#DDDDDD' width='20%'>
                <div align='center'>
                    <strong>Tổng giá trị thanh toán</strong>
                </div>
            </td>
            <td class='bgmenupro border3' bgcolor='#DDDDDD' >
                <div align='center'>
                          <strong>Trạng thái</strong>
                </div>
            </td>
            <td class='bgmenupro borderfull' bgcolor='#DDDDDD' width='15%'>
                <div align='center'>
                    <strong>Ngày giao hàng</strong>
                </div>
            </td>
            
        </tr>
        <!--load đơn hàng-->
        {foreach from=$listorder item=order}    
            <tr>
                <td class='border3'>
                    <div align='center'>{$order@index+1}</div>
                </td>
                <td class='border3'>
                    <div align='center'>{$order.orderdatecreate|date_format:"%d-%m-%Y | %H:%M:%S"}</div>
                </td>
                <td class='border3'>
                    <div align='center'>
                        <a href='/detailorder/{$order.ordercode}' onclick="NewWindow(this.href,'ThegioiKts','900','650','yes');return false">
                            <strong>{$order.ordercode}</strong>
                        </a>
						<input type="hidden" id="ordercode[{$order@index}]" name="ordercode[{$order@index}]" value="{$order.ordercode}">
                    </div>
                </td>
                <td class=' fontred fontsizecart border3'>
                    <div align='center'>{$order.totalprice|number_format} VND</div>
                </td>
                <td class=' fontsizecart border3'>
                    <div align='center'>
                        <select id="orderstatus[{$order@index}]" name="orderstatus[{$order@index}]">
                            {foreach from=$status item=stt}
                                {if $order.idstatus==$stt.idstatus}
                                    <option value="{$stt.idstatus}" selected="selected">{$stt.statusname}</option>
                                {else}
                                    <option value="{$stt.idstatus}">{$stt.statusname}</option>
                                {/if}
                            {/foreach}
                        </select
                    </div>
                </td>  
                <td class='borderfull'>
                    <div align='center'>
                        <input type="date" id="orderdateship[{$order@index}]" name="orderdateship[{$order@index}]"
							value='{$order.orderdateship|date_format:"Y-m-d"}'
							{if $order.idstatus == 4}disabled="disabled"{/if}>
                    </div>
                </td>
               
            </tr>
        {/foreach}
        <!--load xong -->
        <tr>
            <td colspan="7">
                <br>
                <div align='center'>
                    <input type="submit" id="order_save" name="order_save" value="Lưu CSDL">
                    <input type="reset" id="order_reset" name="order_reset" value="Làm lại">
                </div>
            </td>
        </tr>

    </table>
</form>
<br />
<!-- begin: popup!-->
<script language="javascript">

    /*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
     */

    var win = null;
    function NewWindow(mypage,myname,w,h,scroll){
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    settings =
        'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
    win = window.open(mypage,myname,settings)
}

</script>
<!-- end: popup!-->
<!--loc-->
